<?php 
/*
文件名:left.inc.html
编译日期:2020-06-02 02:44:04
文件大小:3.756KB
作者:阳升工作室, http://www.kupebank.com QQ:124181646*/
 ?><?php
$db = m('module');
$adminMenu = $db->getAdminMenu();
$C = load::loadClass('router')->c;
$M = load::loadClass('router')->m;
$adminTag = $db->getTag();
?>

<div class="layui-header">
    <div class="layui-logo" style="color:#fff;font-size:25px;"> <a class="" style="color:#FF5722" href="<?php echo router::_tpl_url(array()); ?>"><i class="layui-icon" style="font-size: 35px; ">&#xe68e;</i>  网站后台</a></div>
    <!-- 头部区域（可配合layui已有的水平导航） -->
    <ul class="layui-nav layui-layout-left" style="display:00none">
	<li class="layui-nav-item <?php if( $_SESSION['user']['tag']=='all'){?>layui-this<?php } ?>"><a href="<?php echo router::_tpl_url(array('c'=>'index','m'=>'index','tag'=>'all')); ?>">所有菜单</a></li>
	<?php foreach( $adminTag as $k => $v){?>
      <li class="layui-nav-item <?php if( $_SESSION['user']['tag']==$k){?>layui-this<?php } ?>"><a href="<?php echo router::_tpl_url(array('c'=>'index','m'=>'index','tag'=>$k)); ?>"><?php echo $v;?></a></li>
	  <?php } ?>
      <li class="layui-nav-item" style="display:none">
        <a href="javascript:;">其它系统</a>
        <dl class="layui-nav-child">
          <dd><a href="">邮件管理</a></dd>
          <dd><a href="">消息管理</a></dd>
          <dd><a href="">授权管理</a></dd>
        </dl>
      </li>
    </ul>
    <ul class="layui-nav layui-layout-right">
      <li class="layui-nav-item">
        <a href="javascript:;">
          <img src="http://t.cn/RCzsdCq" class="layui-nav-img">
          <?php echo $_SESSION['user']['login'];?>
        </a>
        <dl class="layui-nav-child">
          <dd><a href="<?php echo router::_tpl_url(array('c'=>'user','m'=>'myinfo')); ?>">基本资料</a></dd>
		  
          <dd><a href="<?php echo router::_tpl_url(array('c'=>'user','m'=>'changepassword')); ?>" class="left_menu">密码修改</a></dd>
        </dl>
      </li>
      <li class="layui-nav-item"><a href="<?php echo router::_tpl_url(array('c'=>'index','m'=>'logout')); ?>">退出</a></li>
    </ul>
  </div>
  
  <div class="layui-side layui-bg-black">
    <div class="layui-side-scroll">
      <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
      <ul class="layui-nav layui-nav-tree"  lay-filter="test">
        

		<?php foreach( $adminMenu as $k => $v){?>
		
        <!--模块-->
		<li class="layui-nav-item layui-nav-itemed">
          <a href="javascript:;" class="n"> <?php echo $v["name"];?> </a>
          <dl class="layui-nav-child ll-child">
			<?php foreach( $v['op'] as $kk => $vv){ if(checkAuth($vv['module_id'], $vv['method'])) {  if( $vv['other'] == ''){?>
					<dd><a href="<?php echo router::_tpl_url(array('c'=>$vv["module_id"],'m'=>$vv["method"])); ?>"><?php echo showIcon($vv['tpl']); echo $vv["name"];?></a></dd>
					<?php }elseif( $vv['other'] == 'ajax'){?>
						<dd><a href="<?php echo router::_tpl_url(array('c'=>$vv["module_id"],'m'=>$vv["method"])); ?>" class="left_menu"><?php echo showIcon($vv['tpl']); echo $vv["name"];?></a></dd>
					<?php }  }  } ?>
          </dl>
        </li>
        <!--/模块-->
		
		<?php } ?>

		
		


        <!---<li class="layui-nav-item"><a href="">云市场</a></li>
        <li class="layui-nav-item"><a href="">发布商品</a></li>--->
      </ul>
    </div>
  </div>


  <script>
  layui.use(['layer'], function(){

	  $ = layui.$ ;  
	  $.each($('.left_menu'),function(){		
			$(this).click(function(){
				openPage($(this).attr('href'),$(this).html());

				return false;
			});
		});

		$(function(){
		$('.ll-child').each(function(){
			if($(this).find('dd').html() == undefined){
				$(this).parent().css("display","none");
			}else{
				$(this).parent().css("display","");
			}
		});
	  })
  
  });


  </script>
